import request from '@/utils/request'
export function ProductLineList(params) {
  return request({
    url: `/DeviceManager/ProductLineManager/ProductLineInfo/Index=0&Count=10?MatchString=`,
    method: 'get',
    params,
  })
}

export function DeviceListList(params) {
  return request({
    url: `/DeviceManager/ProductLineManager/DeviceListInfo/LineId=${params.LineId}&Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function ProductLineInfo(data) {
  return request({
    url: '/DeviceManager/ProductLineManager/ProductLineInfo/Newly/',
    method: 'post',
    data,
  })
}

export function DeviceListInfo(data) {
  return request({
    url: '/DeviceManager/ProductLineManager/DeviceListInfo/Newly/',
    method: 'post',
    data,
  })
}

export function ProductLineDelete(data) {
  return request({
    url: `/DeviceManager/ProductLineManager/ProductLineInfo/LineId=${data.LineId}`,
    method: 'delete',
    data,
  })
}

export function DeviceListDelete(data) {
  return request({
    url: `/DeviceManager/ProductLineManager/DeviceListInfo/LineId=${data.LineId}&DeviceId=${data.DeviceId}`,
    method: 'delete',
    data,
  })
}

// 设备台账
export function EquipmentList(params) {
  return request({
    url: `/DeviceManager/DeviceInfo/Index=${params.Index}&Count=${params.Count}&MatchString=${params.MatchString}`,
    method: 'get',
    params,
  })
}

export function EquipmentLists(params) {
  return request({
    url: `/DeviceManager/DeviceInfo/AllDeviceId`,
    method: 'get',
    params,
  })
}

export function EquipmentInfo(data) {
  return request({
    url: '/DeviceManager/DeviceInfo/Newly/',
    method: 'post',
    data,
  })
}

export function EquipmentDelete(data) {
  return request({
    url: `/DeviceManager/DeviceInfo/DeviceId=${data.DeviceId}`,
    method: 'delete',
    data,
  })
}
// 设备台账

export function AvailableDeviceList(params) {
  return request({
    url:
      '/DeviceManager/ProductLineManager/DeviceListInfo/AvailableDevice/LineId=' +
      params.LineId,
    method: 'get',
    params,
  })
}

//设备维修统计信息获取
export function InformationStatistics(params) {
  return request({
    url: '/DeviceManager/Repair/Information/Statistics/',
    method: 'get',
    params,
  })
}
export function DeviceFaultInfo(params) {
  return request({
    url: `/DeviceManager/Repair/DeviceFaultInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function RepairRecord(params) {
  return request({
    url: `/DeviceManager/Repair/RepairRecord/Index=${params.Index}&Count=${params.Count}&State=${params.State}`,
    method: 'get',
    params,
  })
}

export function UsageStatistics(params) {
  return request({
    url: `/DeviceManager/UsageStatistics/DeviceId=${params.DeviceId}&StartTime=${params.StartTime}&EndTime=${params.EndTime}`,
    method: 'get',
    params,
  })
}

export function StateMonitorStatistics(params) {
  return request({
    url: `/DeviceManager/StateMonitor/Statistic`,
    method: 'get',
    params,
  })
}

export function DeviceState(params) {
  return request({
    url: `/Home/DeviceState/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
export function DeviceListInfoType(params) {
  return request({
    url: `/DeviceManager/StateMonitor/Statistic/DeviceListInfo/Type=${params.Type}&Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
export function DeviceDetailsInfo(params) {
  return request({
    url: `/Home/DeviceDetailsInfo/DeviceId=${params.DeviceId}`,
    method: 'get',
    params,
  })
}

export function RealTimeList(params) {
  return request({
    url: `/DeviceManager/FaultManager/RealTime/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function HistoryList(params) {
  return request({
    url: `/DeviceManager/FaultManager/History/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function FaultIdDelete(data) {
  return request({
    url: `/DeviceManager/FaultManager/RealTime/FaultId=${data.FaultId}`,
    method: 'delete',
    data,
  })
}

export function GetAllDeviceType(params) {
  return request({
    url: `/DeviceManager/DeviceInfo/GetAllDeviceType/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
//设备保养信息统计
export function MainrenanceStatistics(params) {
  return request({
    url: `/DeviceManager/Mainrenance/Information/Statistics`,
    method: 'get',
    params,
  })
}
export function FinishMainrenance(params) {
  return request({
    url: `/DeviceManager/Mainrenance/Information/FinishMainrenance/Type=${params.Type}&Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function WaitMainrenanceList(params) {
  return request({
    url: `/DeviceManager/Mainrenance/Information/WaitMainrenanceList/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function GetProduction(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/GetProduction`,
    method: 'get',
    params,
  })
}

export function OkButtonClick(data) {
  return request({
    url: `/DeviceManager/Mainrenance/Information/OkButtonClick/MainrenanceId=${data.MainrenanceId}`,
    method: 'post',
    data,
  })
}

export function IsOkButtonClick(data) {
  return request({
    url: `/DeviceManager/Repair/RepairRecord/IsOkButtonClick/RepairId=${data.RepairId}`,
    method: 'post',
    data,
  })
}

export function GetDeviceLogById(params) {
  return request({
    url: `/DeviceLog/GetDeviceLogById/DeviceId=${params.DeviceId}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
